{% extends 'backend/base.html' %}
{% load static %}
{% block content %}
 <div class="article_list small">
                             <table class="table table-hover table-striped">
                                 <thead>
                                     <th>标题</th>
                                     <th>评论数</th>
                                     <th>点赞数</th>
                                     <th>操作</th>
                                     <th>操作</th>
                                 </thead>
                                 <tbody>
                                     {% for article in article_list %}
                                     <tr>
                                         <td>{{ article.title }}</td>
                                         <td>{{ article.comment_count }}</td>
                                         <td>{{ article.up_count }}</td>
                                         <td><a href="//">编辑</a></td>
                                         <td><a href="">删除</a></td>
                                     </tr>
                                     {% endfor %}

                                 </tbody>
                             </table>
                        </div>
{% endblock %}
<script>
    // 删除博客
    $(".article_list small").click(function () {
        $.ajax({
            url: "/de_article/",
            type: "post",
            data: {
                title: $("#td").val(),
                csrfmiddlewaretoken: $("[name='csrfmiddlewaretoken']").val(),
            },
            success: function (data) {
                // 将会在控制台打印log信息，据此可以判断获取信息是否全面准确
                console.log(data);
            }
        })
    })
</script>